/***********************************************************************************************************************************
 *    Name: Configure_Recovery.sql
 *  Author: Frank Figearo — http://www.sqlnerd.me/ — frank@sqlnerd.me
 * Summary: Set DB recovery options for the production environment.
 */
USE master;
ALTER DATABASE master SET RECOVERY SIMPLE, PAGE_VERIFY CHECKSUM;
ALTER DATABASE model SET RECOVERY SIMPLE, PAGE_VERIFY CHECKSUM;
ALTER DATABASE msdb SET RECOVERY SIMPLE, PAGE_VERIFY CHECKSUM;
GO
DECLARE @tsql NVARCHAR(MAX);
SET @tsql= N'';
SELECT  @tsql= @tsql + N'ALTER DATABASE [' + name + N'] SET RECOVERY SIMPLE, PAGE_VERIFY CHECKSUM;'
  FROM sys.databases
  WHERE 4 < database_id AND state = 0;
EXECUTE (@tsql);
GO